﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using XJay.Scheduler.IService;
using XJay.Scheduler.Model.User.Export;
using XJay.Scheduler.Model.User.Import;

namespace XJay.Scheduler.Controllers
{
    /// <summary>
    /// 用户模块
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class UserController : BaseController
    {

        private readonly IUserServer _userServer;

        public UserController(IUserServer userServer)
        {
            this._userServer = userServer;
        }
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<UserDto> Login(LoginParam param)
        {
            return await _userServer.LoginAsync(param);
        }
    }
}
